package com.zb.file.service.impl;

import com.zb.constant.FileUploadModuleType;
import com.zb.file.service.FileService;
import com.zb.util.FileUploadUtil;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @Author WEN
 * @Date 2023/8/11 0011
 **/
@Service
public class FileServiceImpl implements FileService {

    // Logo上传
    @Override
    public String logoUpload(String uploadPath, String annexVisitPath, String custAccLogoCode, MultipartFile file) {
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath,  custAccLogoCode, FileUploadModuleType.LOGO, file);
    }

    // 工单附件上传
    @Override
    public List<String> orderAnnexUpload(String uploadPath, String annexVisitPath, String custAccAnnexCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath,  custAccAnnexCode, FileUploadModuleType.ORDER, files);
    }

    // 商品附件上传
    @Override
    public List<String> goodsAnnexUpload(String uploadPath, String annexVisitPath, String custAccAnnexCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath,  custAccAnnexCode, FileUploadModuleType.GOODS, files);
    }

    // 用户附件上传
    @Override
    public List<String> userAnnexUpload(String uploadPath, String annexVisitPath, String custAccAnnexCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath,  custAccAnnexCode, FileUploadModuleType.USER, files);
    }

    // 知识中心附件上传
    @Override
    public List<String> knowledgeAnnexUpload(String uploadPath, String annexVisitPath, String custAccAnnexCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath,  custAccAnnexCode, FileUploadModuleType.KNOWLEDGE, files);
    }

    // 知识中心视频上传
    @Override
    public List<String> knowledgeUpload(String videoUploadPath, String videoVisitPath, String custAccVideoCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadVideoFile(videoUploadPath, videoVisitPath, custAccVideoCode, FileUploadModuleType.KNOWLEDGE, files);
    }

    // 头像上传接口
    @Override
    public String avatarUpload(String uploadPath, String annexVisitPath, String custAccAnnexCode, MultipartFile file){
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath,  custAccAnnexCode, FileUploadModuleType.AVATAR, file);
    }

    // 编码附件上传接口
    @Override
    public List<String> codeUpload(String uploadPath, String annexVisitPath, String custAccAnnexCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath,  custAccAnnexCode, FileUploadModuleType.CODE, files);
    }

    // 工单视频上传
    @Override
    public List<String> orderVideoUpload(String videoUploadPath, String videoVisitPath, String custAccVideoCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadVideoFile(videoUploadPath, videoVisitPath, custAccVideoCode, FileUploadModuleType.ORDER, files);
    }

    // 系统附件上传
    @Override
    public List<String> sysUpload(String uploadPath, String annexVisitPath, String custAccAnnexCode, List<MultipartFile> files) {
        return FileUploadUtil.uploadAnnexFile(uploadPath, annexVisitPath, custAccAnnexCode, FileUploadModuleType.SYSTEM, files);
    }


}
